package com.youlai.boot.factory.model.vo;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;

/**
 * 租户数据源配置视图对象
 *
 * @author youlaitech
 * @since 2025-11-22 08:31
 */
@Getter
@Setter
@Schema( description = "租户数据源配置视图对象")
public class SysTenantDatasourceVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    private Long id;
    @Schema(description = "租户ID（关联sys_tenant.id）")
    private Long tenantId;
    @Schema(description = "租户编码（冗余字段，方便查询）")
    private String tenantCode;
    @Schema(description = "数据源名称")
    private String datasourceName;
    @Schema(description = "数据源类型：MySQL、PostgreSQL等")
    private String datasourceType;
    @Schema(description = "驱动类名")
    private String driverClassName;
    @Schema(description = "数据库连接URL")
    private String url;
    @Schema(description = "数据库用户名")
    private String username;
    @Schema(description = "数据库密码（建议加密存储）")
    private String password;
    @Schema(description = "初始连接数")
    private Integer initialSize;
    @Schema(description = "最小空闲连接数")
    private Integer minIdle;
    @Schema(description = "最大活跃连接数")
    private Integer maxActive;
    @Schema(description = "最大等待时间(毫秒)")
    private Long maxWait;
    @Schema(description = "验证查询SQL")
    private String validationQuery;
    @Schema(description = "数据源状态：1-启用 0-禁用")
    private Integer status;
    @Schema(description = "是否主数据源：1-是 0-否（租户可能有多个数据源）")
    private Integer isPrimary;
    @Schema(description = "备注说明")
    private String remark;
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
    @Schema(description = "创建人ID")
    private Long createBy;
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
    @Schema(description = "更新人ID")
    private Long updateBy;
    @Schema(description = "逻辑删除(1-已删除 0-未删除)")
    private Integer isDeleted;
}
